#ifndef __FILTER_ALGORITHM_H__
#define __FILTER_ALGORITHM_H__

#include <rtthread.h>
#include <math.h>

#ifdef __cplusplus
extern "C" {
#endif


typedef enum
{
    FA_Filter_Type_AL,//限幅滤波算法
    FA_Filter_Type_MV,//中位值滤波算法
    FA_Filter_Type_AA,//算术平均滤波算法
    FA_Filter_Type_RA,//递推平均滤波算法
    FA_Filter_Type_MVA,//中位值平均滤波算法
    FA_Filter_Type_LA,//限幅平均滤波算法
    FA_Filter_Type_FOL,//一阶滞后滤波算法
    FA_Filter_Type_WRA,//加权递推平均滤波算法
    FA_Filter_Type_VE,//消抖滤波算法
    FA_Filter_Type_LVE,//限幅消抖滤波算法
    FA_Filter_Type_K,//卡尔曼滤波算法
}FA_Filter_Type;


rt_uint32_t FA_Amplitude_Limiting_Filtering_Algorithm(rt_uint8_t A, rt_uint32_t old_value, rt_uint32_t new_value);//限幅滤波算法
rt_uint32_t FA_Median_Value_Filtering_Algorithm(rt_uint8_t N, rt_uint32_t *value_buf);//中位值滤波算法
rt_uint32_t FA_Arithmetic_Average_Filtering_Algorithm(rt_uint8_t N, rt_uint32_t *value_buf);//算术平均滤波算法
rt_uint32_t FA_Recursive_Average_Filtering_Algorithm(rt_uint8_t N, rt_uint32_t *value_buf);//递推平均滤波算法
rt_uint32_t FA_Median_Value_Average_Filtering_Algorithm(rt_uint8_t N, rt_uint32_t *value_buf);//中位值平均滤波算法
rt_uint32_t FA_Limiting_Average_Filtering_Algorithm(rt_uint8_t A, rt_uint8_t N, rt_uint32_t old_value, rt_uint32_t new_value);//限幅平均滤波算法
rt_uint32_t FA_First_Order_Lag_Filtering_Algorithm(rt_uint8_t a, rt_uint32_t old_value, rt_uint32_t new_value);//一阶滞后滤波算法
rt_uint32_t FA_Weighted_Recursive_Average_Filtering_Algorithm(rt_uint8_t N, rt_uint32_t *value_buf);//加权递推平均滤波算法
rt_uint32_t FA_Vibration_Elimination_Filtering_Algorithm(rt_uint8_t N, rt_uint32_t old_value, rt_uint32_t new_value);//消抖滤波算法
rt_uint32_t FA_Limiting_Vibration_Elimination_Filtering_Algorithm(rt_uint8_t A, rt_uint8_t N, rt_uint32_t old_value, rt_uint32_t new_value);//限幅消抖滤波算法
rt_uint32_t FA_Kalman_Filtering_Algorithm(rt_uint32_t old_value, rt_uint32_t new_value);//卡尔曼滤波算法


#ifdef __cplusplus
}
#endif

#endif /*__FILTER_ALGORITHM_H__*/
